// 引入router的一些方法.
import { createWebHistory , createRouter } from 'vue-router'
// 定义路由规则
const routes = [
    { path: '/', component: ()=> import("../views/welcome.vue")},
    { path: '/home',
        component: ()=> import("../views/home.vue"),
        children:[
            {
                path:"contentCategory-add",
                component:()=>import("../views/contentCategory/contentCategory-add.vue")
            },{
                path:"contentCategory-list",
                component:()=>import("../views/contentCategory/contentCategory-list.vue")
            },{
                path:"content-list",
                component:()=>import("../views/content/content-list.vue")
            },{
                path:"content-add",
                component:()=>import("../views/content/content-add.vue")
            },{
                path:"goods-list",
                component:()=>import("../views/goods/goods-list.vue")
            },{
                path:"goods-add",
                component:()=>import("../views/goods/goods-add.vue")
            },{
                path:"goods-category-list",
                component:()=>import("../views/goods/goods-category-list.vue")
            },{
                path:"goods-category-add",
                component:()=>import("../views/goods/goods-category-add.vue")
            },{
                path:"goods-spe-list",
                component:()=>import("../views/goods/goods-spe-list.vue")
            },{
                path:"goods-spe-add",
                component:()=>import("../views/goods/goods-spe-add.vue")
            },{
                path:"goods-spe-item-list/:speId",
                component:()=>import("../views/goods/goods-spe-item-list.vue")
            }
        ]
    },
]
// 创建路由对象
const router = createRouter({
    history: createWebHistory(),
    routes,
})
//暴露路由对象
export default router;